#include<bits/stdc++.h>
using namespace std;

int dp[200010];
int a[200010];

int main()
{
	int n, m, k;
	cin>>n>>m>>k;
	for(int i = 1;i <= n;i++)
	{
		cin>>a[i];
		if(a[i] > k)
			dp[i] = 0;
		else
			dp[i] = dp[i-1]+1;
	}
	int ans = 0;
	for(int i = 1;i <= n;i++)
		if(dp[i] >= m)
			ans++;
	cout<<ans;
	return 0;
}

